package com.tianyu.jty.system.service;

import com.jswzc.jiuling.service.order.TzServiceI;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

/**
 * 定时任务工作类 泰州
 * @author ty
 * @date 2015年1月13日
 */
@DisallowConcurrentExecution
@Component("TaskTz")
    public class TaskTz implements Job {

    private TzServiceI tzService;

    public void execute(JobExecutionContext context) throws JobExecutionException {
//        try {
//            ClassPathXmlApplicationContext contexts;
//            contexts = new ClassPathXmlApplicationContext(
//                    "classpath*:/applicationContext-dubbo.xml");
//            contexts.start();
//            tzService = (TzServiceI) contexts.getBean("tzService"); // 获取远程服务代理
//          //  tzService.cancelDetail();
//            System.out.println(tzService.closeOrder());
//
//            ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
//            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
//            System.out.println("任务名称 = [" + scheduleJob.getName() + "]" + " 在 " + dateFormat.format(new Date()) + " 时运行");
//        }catch (Exception e){
//            e.printStackTrace();
//        }
    }
}
